{% load staticfiles %}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<title>周总结提交平台</title>
	<link rel="stylesheet" href="{% static 'css/style.css' %}">
	<meta name="viewport" content="width=device-width, initial-scale=1" />
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="keywords" content="File Upload widget Widget Responsive, Login Form Web Template, Flat Pricing Tables, Flat Drop-Downs, Sign-Up Web Templates, Flat Web Templates, Login Sign-up Responsive Web Template, Smartphone Compatible Web Template, Free Web Designs for Nokia, Samsung, LG, Sony Ericsson, Motorola Web Design" />
	<link rel="stylesheet" type="text/css" href="http://www.jq22.com/jquery/bootstrap-3.3.4.css">
	<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>		
</head>

<body>

    <ul>
        {% if user.is_authenticated %}
                <li>
                        <p>Hello,{{ user.first_name }} !</p>
                </li>
                <li>
                        <p><a href="{% url 'USER:logout' %}">注销</a></p>
                </li>
            <li>
            <a href="{% url 'USER:reset_password' user.username %}" >修改密码</a>
        </li>
        {% else %}

		<li>
            <a href="{% url 'USER:login' %}" target="_blank">登录</a>
        </li>
        {% endif %}
        <li style="margin-top: 20px;"><a href="{% url 'ITEM:get' %}" target="_blank">获取</a></li>
	</ul>
<h1>长大在线周总结提交平台</h1>
<div class="agile-its">
	<h2>File Upload</h2>
	<div class="w3layouts">
	<p>This is not useful English, just to make the site look more western, but also to make the site look rich, not so boring.</p>
		<div class="photos-upload-view">
             {% csrf_token %}
			<form id="upload" action="/push_handle" method="POST" enctype="multipart/form-data">
				
					<div class="release">
					
						<div class="upload-file">

								<input type="file" class="input-file"  name="document" accept=".md, .doc, .docx, .txt, .html" required>

								<span class="tip">点击上传周总结</span>
						</div>
                        <input type="hidden" name="username" value="{{ user.username }}">
						<input type="submit" value="提交" class="btn btn-success">
					</div>
			</form>
			
		</div>
		<div class="clearfix"></div>
		</div>
</div>
<div class="footer">
	<p> © 2019 Week Summary Upload Platform. All Rights Reserved. </p>

</div>
<div class="div"><p>{{ message }}</p></div>
{#<script type="text/javascript" src="js/jquery.min.js"></script>#}
    <script type="text/javascript" src="{% static 'js/jquery.min.js' %}"></script>
<script>
	var fileInput = document.querySelector('.input-file');
    var tip = document.querySelector('.tip');
 
    fileInput.addEventListener('change',function(e){ //监听change事件，选择文件后触发
      if(this.files.length === 1){ //处理文件名
        tip.textContent = this.files[0].name;
      }else {
        tip.textContent = '已选择 ' + this.files.length + ' 个文件';
      }
    })
</script>
 <script>
     {% if message %}
            $('.div').fadeIn(2200).fadeOut(4200);
     {% endif %}
		// $('.div').show(2000);
		{#var value = false;#}
		{#if(value){#}
		{#	$('.div').fadeIn(4200).fadeOut(4200);#}
		{##}

			
		</script>
</body>
</html>